<template>
  <!-- 成本试算 -->
  <div>
    <custom-container
      ref="customContainerRef"
      :config="mainConfig"
    ></custom-container>
  </div>
</template>
<script lang="ts" setup>
import { computed, ref, defineAsyncComponent } from 'vue'
import {
  Plus,
  Edit,
  Delete,
  Search,
  Upload,
  Bottom,
  Key,
  UploadFilled,
} from '@element-plus/icons-vue'
import { ElButton, ElMessageBox, ElMessage, ElSwitch } from 'element-plus'
import { ClientRequest } from 'http'
import { DictDirection } from '@/store/modules/dicts'

const // 选中数组
  ids = [],
  // 非多个禁用
  multiple = ref(false),
  // 非单个禁用
  single = ref(false),
  customContainerRef = ref(null),
  // 查询
  queryParams = ref({
    pageNum: 1,
    pageSize: 10,
    custCodeList: undefined,
    wholeName: undefined,
    simpleName: undefined,
    status: undefined,
    grade: undefined,
  })

const mainConfig = computed({
  get() {
    return {
      query: {
        fields: [
          {
            label: '目的国家',
            prop: 'countryCode',
            width: '240',
            option: {
              placeholder: '请选择目的国家',
              clearable: true,
            },
          },
          {
            label: '重量',
            prop: 'weight',
            option: {
              controls: false,
            },
          },
          {
            label: '货物类型',
            prop: 'goodsType',
            width: '240',
            option: {
              placeholder: '请选择货物类型',
              clearable: true,
            },
          },
          {
            label: '邮编',
            prop: 'postCode',
            option: {
              controls: false,
            },
          },
          {
            label: '服务渠道',
            prop: 'serviceChannelCode',
            width: '240',
            option: {
              placeholder: '请选择服务渠道',
              clearable: true,
            },
          },
        ],
        queryParams: queryParams.value,
      },
      btns: [],
      table: {
        columns: [
          {
            label: '服务渠道代码',
            prop: 'serviceChannelCode',
            width: '180',
          },
          {
            label: '服务渠道中文名称',
            prop: 'channelChName',
            width: '180',
          },
          {
            label: '重量',
            prop: 'weight',
          },
          {
            label: '单价',
            prop: 'unitPrice',
          },
          {
            label: '总金额',
            prop: 'totalAmount',
          },
          {
            prop: 'incidental',
            label: '杂物费',
          },
          {
            label: '燃油系数',
            prop: 'fuelCoefficient',
          },

          {
            label: '材级系数',
            prop: 'volumeCoefficient',
          },

          {
            label: '货物类型',
            prop: 'goodsType',
          },
          {
            label: '备注',
            prop: 'remarks',
          },
        ],
      },
      api: '',
    }
  },
  set(v) {
    return v
  },
})
</script>
